package hy.config;

import a.A;
import a.Cfg2;
import a.MySelector;
import hy.B;
import hy.Stu;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

//@ConditionalOnMissingBean(name="a")
@Import({A.class, Cfg2.class, MySelector.class})
@Configuration
public class MyCfg {
    @ConditionalOnClass(B.class)
    @Bean
    public Stu getS(){
        return new Stu();
    }
}
